import 'package:enterprise_v6_app/generated/json/base/json_convert_content.dart';
import 'package:enterprise_v6_app/app/data/entities/application/emergency/emergency_task_user_entity.dart';

EmergencyTaskUserEntity $EmergencyTaskUserEntityFromJson(Map<String, dynamic> json) {
  final EmergencyTaskUserEntity emergencyTaskUserEntity = EmergencyTaskUserEntity();
  final String? createBy = jsonConvert.convert<String>(json['createBy']);
  if (createBy != null) {
    emergencyTaskUserEntity.createBy = createBy;
  }
  final String? createById = jsonConvert.convert<String>(json['createById']);
  if (createById != null) {
    emergencyTaskUserEntity.createById = createById;
  }
  final String? createDate = jsonConvert.convert<String>(json['createDate']);
  if (createDate != null) {
    emergencyTaskUserEntity.createDate = createDate;
  }
  final String? deleted = jsonConvert.convert<String>(json['deleted']);
  if (deleted != null) {
    emergencyTaskUserEntity.deleted = deleted;
  }
  final String? id = jsonConvert.convert<String>(json['id']);
  if (id != null) {
    emergencyTaskUserEntity.id = id;
  }
  final String? taskInstructions = jsonConvert.convert<String>(json['taskInstructions']);
  if (taskInstructions != null) {
    emergencyTaskUserEntity.taskInstructions = taskInstructions;
  }
  final String? updateBy = jsonConvert.convert<String>(json['updateBy']);
  if (updateBy != null) {
    emergencyTaskUserEntity.updateBy = updateBy;
  }
  final String? updateById = jsonConvert.convert<String>(json['updateById']);
  if (updateById != null) {
    emergencyTaskUserEntity.updateById = updateById;
  }
  final String? updateDate = jsonConvert.convert<String>(json['updateDate']);
  if (updateDate != null) {
    emergencyTaskUserEntity.updateDate = updateDate;
  }
  final String? userId = jsonConvert.convert<String>(json['userId']);
  if (userId != null) {
    emergencyTaskUserEntity.userId = userId;
  }
  final String? userName = jsonConvert.convert<String>(json['userName']);
  if (userName != null) {
    emergencyTaskUserEntity.userName = userName;
  }
  return emergencyTaskUserEntity;
}

Map<String, dynamic> $EmergencyTaskUserEntityToJson(EmergencyTaskUserEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['createBy'] = entity.createBy;
  data['createById'] = entity.createById;
  data['createDate'] = entity.createDate;
  data['deleted'] = entity.deleted;
  data['id'] = entity.id;
  data['taskInstructions'] = entity.taskInstructions;
  data['updateBy'] = entity.updateBy;
  data['updateById'] = entity.updateById;
  data['updateDate'] = entity.updateDate;
  data['userId'] = entity.userId;
  data['userName'] = entity.userName;
  return data;
}

extension EmergencyTaskUserEntityExtension on EmergencyTaskUserEntity {
  EmergencyTaskUserEntity copyWith({
    String? createBy,
    String? createById,
    String? createDate,
    String? deleted,
    String? id,
    String? taskInstructions,
    String? updateBy,
    String? updateById,
    String? updateDate,
    String? userId,
    String? userName,
  }) {
    return EmergencyTaskUserEntity()
      ..createBy = createBy ?? this.createBy
      ..createById = createById ?? this.createById
      ..createDate = createDate ?? this.createDate
      ..deleted = deleted ?? this.deleted
      ..id = id ?? this.id
      ..taskInstructions = taskInstructions ?? this.taskInstructions
      ..updateBy = updateBy ?? this.updateBy
      ..updateById = updateById ?? this.updateById
      ..updateDate = updateDate ?? this.updateDate
      ..userId = userId ?? this.userId
      ..userName = userName ?? this.userName;
  }
}
